@model ProjectCodeS.Models.Store

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Name)
    @Html.ValidationMessageFor(model => model.Name)
</div>

<div class="editor-label">
    Company
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.CompanyId, ((IEnumerable<ProjectCodeS.Models.Company>)ViewBag.PossibleCompanies).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Name), 
        Value = option.Id.ToString(),
        Selected = (Model != null) && (option.Id == Model.CompanyId)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.CompanyId)
</div>
<div class="editor-label">
    ChargeCategory
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ChargeCategoryId, ((IEnumerable<ProjectCodeS.Models.ChargeCategory>)ViewBag.PossibleChargeCategories).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Name), 
        Value = option.Id.ToString(),
        Selected = (Model != null) && (option.Id == Model.ChargeCategoryId)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ChargeCategoryId)
</div>
